
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="css/common.css"/>
    <link rel="stylesheet" type="text/css" href="css/main.css"/>
    <script type="text/javascript" src="js/libs/modernizr.min.js"></script>
</head>
<body>
<div class="topbar-wrap white">
    <div class="topbar-inner clearfix">
        <div class="topbar-logo-wrap clearfix">
            <h1 class="topbar-logo none"><a href="index.html" class="navbar-brand">后台管理</a></h1>
        </div>
    </div>
</div>
<div class="container clearfix">
    <div class="sidebar-wrap">
        <div class="sidebar-title">
            <h1>菜单</h1>
        </div>
        <div class="sidebar-content">
                        <ul class="sidebar-list">
                <li>
                    <a href="#"><i class="icon-font">&#xe003;</i>常用操作</a>
                    <ul class="sub-menu">
                        <li><a href="administer-user.php"><i class="icon-font">&#xe008;</i>用户管理</a></li>
                        <li><a href="administer-userguest.php"><i class="icon-font">&#xe005;</i>留言管理</a></li>
                        <li><a href="administer-wenzhang.php"><i class="icon-font">&#xe006;</i>添加文章</a></li>
                    </ul>
                </li>
                <li>
                    <ul class="sub-menu">
                        <li><a href="administer-ManageArt.php"><i class="icon-font">&#xe017;</i>文章列表</a></li>
                        <li><a href="administer-Navigation.php"><i class="icon-font">&#xe037;</i>导航管理</a></li>
                        <li><a href="administer-PowerpointList.php"><i class="icon-font">&#xe046;</i>幻灯片管理</a></li>
                        <li><a href="administer-Picture.php"><i class="icon-font">&#xe045;</i>图片管理</a></li>
                        <li><a href="administer-company.php"><i class="icon-font">&#xe035;</i>渠道资格</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <!--/sidebar-->
    <div class="main-wrap">
        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="index.html">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">用户管理</span></div>
        </div>
             <?php
                            session_start();
                            header("Content-Type:text/html;charset=UTF-8");
                            if (isset($_SESSION['id'])) {
                                echo "欢迎".$_SESSION['name']."登录！";
                                echo "<a href='login.html?'logout=logout>注销</a>";
                                $username = $_COOKIE['name'];
                                $password = $_COOKIE['password'];
                                //echo $username,$password;
                                include "shuju.php";
                                $id = $_SESSION['id'];
                                $sql = "select * from user";
                                $db = new DB();
                                $res = $db->get($sql);
                            }else{
                                header("location:login.html");
                            }
                ?> 
        <div class="result-wrap">
        <form name="administer-usermsg" id="myform" method="post">
            <table class="insert-tab" width="95%">
        <?php 
            if (isset($_POST['submit'])) {
                
                $id = $_POST['id'];
                $name = $_POST['name'];
                $password = $_POST['password'];
                $email = $_POST['email'];
                $phone = $_POST['phone'];
                $isdel = $_POST['isdel'];

                echo "<tr><td>用户id</td><td>$id</td></tr>
                    <tr><td>用户姓名</td><td><input type='text' value='$name' name='name1'></td></tr>
                    <tr><td>用户密码</td><td><input type='password' name='password1' value='$password'></td></tr>
                    <tr><td>用户邮箱</td><td><input type='text' value='$email' name='email1'></td></tr>
                    <tr><td>用户手机</td><td><input type='text' value='$phone' name='phone1'></td></tr>
                    <tr><td>审核状态</td><td><input type='text' value='$isdel' name='isdel1'></td></tr>
                    <tr><td></td><td><input type='submit' value='修改信息' name='submit1' class='btn btn-success btn3 mr10'><input type='button' value='返回' onclick='history.go(-1)' class='btn btn-default btn3 mr10'></td></tr><input type='hidden' value='$id' name='id1'>
                ";
            }
                
        ?> 
            </table>
            </form> 
            <?php 
                if (isset($_POST['submit1'])) {
                    $name = $_POST['name1'];
                    $password = $_POST['password1'];
                    $email = $_POST['email1'];
                    $phone = $_POST['phone1'];
                    $isdel = $_POST['isdel1'];
                    $id = $_POST['id1'];
                    $db = new DB();
                    $sql = "update lll set name = '$name', password = '$password',email='$email',phone = '$phone',is_del = '$isdel' where id = '$id'";
                    $res = $db->update($sql);
                    echo "<script>alert('更改成功');location.href='administer-user.php';</script>";

                }
             ?>   
        </div>
    </div>
    <!--/main-->
</div>
</body>
</html>